package xinxin.com.InterpreterPatternBasic;

import xinxin.com.InterpreterPatternBasic.context.Context;
import xinxin.com.InterpreterPatternBasic.expression.AbstractExpression;
import xinxin.com.InterpreterPatternBasic.expression.impl.NoterminalExpression;
import xinxin.com.InterpreterPatternBasic.expression.impl.TerminalExpression;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ：史鑫鑫
 * @date ：Created in 2019/4/9 20:39
 */
public class InterpreterPatternBasic {
    public static void main(String[] args) {
        Context context = new Context();
        List<AbstractExpression> list = new ArrayList<>();
        list.add(new TerminalExpression());
        list.add(new NoterminalExpression());
        list.add(new TerminalExpression());
        list.add(new TerminalExpression());

        for (AbstractExpression exp : list) {
            exp.Interpret(context);
        }
    }
}
